$(function(){


    //    爱心变色
    var index=$(this).index();
    // console.log($(".liker>img"));
    $(".liker>img").click(function(){
        $(this).attr("src","./yuba_img/ybaixin.png");
        
    })
    // function liker_click(t) {
    //     $(t).attr("src","./yuba_img/ybaixin.png");
    //     console.log(123);
    // }
    $(".sc>img").click(function(){
        $(this).attr("src","./yuba_img/shoucang2.png");
        
    })
    $(".zf>img").click(function(){

        $(this).attr("src","./yuba_img/zhuanfa2.png");
        
    })
    // 点击定位
    $(".go").click(function(){
        $(this).css("background","rgba(255, 255, 255, 0.1542)").siblings().css("background","none");
        $(".yb_center").animate({"scrollTop":$(".d_box").eq($(this).index()).offset().top},1000);

    })
   



    // 点击更换头像
    if (typeof FileReader == 'undefined') {
        document.getElementById("xmTanDiv").InnerHTML = "<h1>当前浏览器不支持FileReader接口</h1>";
        document.getElementById("xdaTanFileImg").setAttribute("disabled", "disabled");
    }
    //选择图片，马上预览
    function xmTanUploadImg(obj) {
        console.log(obj)
        var file = obj.files[0];  
        console.log(obj);console.log(file);
        console.log("file.size = " + file.size);
        var reader = new FileReader();
        reader.onloadstart = function (e) {
            console.log("开始读取....");
        }
        reader.onprogress = function (e) {
            console.log("正在读取中....");
        }
        reader.onabort = function (e) {
            console.log("中断读取....");
        }
        reader.onerror = function (e) {
            console.log("读取异常....");
        }
        reader.onload = function (e) {
            console.log("成功读取....");
            var img = document.getElementById("avarimgs");
            img.src = e.target.result;
            //或者 img.src = this.result; //e.target == this
        }
        reader.readAsDataURL(file)
    }
    // $('.card_buttom>.liker>img').click(function(){
    //     $(this).attr("src","./yuba_img/ybaixin.png");
    // })
})
// function liker_click(t) {
//     $(t).attr("src","./yuba_img/ybaixin.png");
// }
// function liker_click(t) {
//     $(this).attr("src","./yuba_img/shoucang2.png");
//     console.log(123);
// }
// function liker_click(t) {
//     $(this).attr("src","./yuba_img/zhuanfa2.png");
// }